package cn.humaohua.study.yanmo_design_pattern.ch12.v3;

public class Main {
    public static void main(String[] args) {
        WatcherObserver observer1 = new Watcher();
        observer1.setJob("监测人员");

        WatcherObserver observer2 = new Watcher();
        observer2.setJob("预警人员");

        WatcherObserver observer3 = new Watcher();
        observer3.setJob("监测部门领导");

        WaterQuality waterQuality = new WaterQuality();
        waterQuality.attach(observer1);
        waterQuality.attach(observer2);
        waterQuality.attach(observer3);

        waterQuality.setPolluteLevel(0);
        System.out.println("-----------------");
        waterQuality.setPolluteLevel(1);
        System.out.println("-----------------");
        waterQuality.setPolluteLevel(2);
    }
}
